<div id="department-body">
    <div class="department-panel">
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">操作</label>
                <div class="layui-input-block">
                    <button type="button" onclick="SetPopup('添加部门','AddDepartment')" class="layui-btn layui-btn-normal">添加部门</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    renderTable({
        elem: '#department-body',
        model: "departments",
        pk: "department_id",
        tableApi: api.department.getAllDepartment,
        updateApi: api.department.editDepartment,
        delApi: api.department.delDepartment,
        cols: [
            { field: 'department_id', title: '编号', width: 80, sort: true, fixed: 'left' }
            , { field: 'user_id', title: '部长', width: 100 }
            , { field: 'department_name', title: '名称', width: 100 }
            , { field: 'department_info', title: '简介', edit: 'text', sort: true }
            , { field: 'create_time', title: '创建时间', width: 150, sort: true }
            , { fixed: 'right', width: 165, align: 'center', toolbar: '#layuiActtion' }
        ],
    });
</script>